import React ,{useState} from 'react'
import style from './index.module.scss'
const Index:React.FC = () => {
  const [yhj,setYhj]=useState(localStorage.getItem('yhj'))
    const add=()=>{
    localStorage.setItem('yhj', '2')
    setYhj('2')
    console.log(1);
    
    }
  return (
    <div className={style.box}>
      <img style={{width: '100%'}} src="../../src/img/yhj.png" alt="" />
      <div className={style.btn}>
        <button disabled={yhj?true:false} onClick={()=>add()}>{yhj?'已经领取':"立即领取"}</button>
      </div>
    </div>
  )
}

export default Index
